package com.Renting.service.impl;

import com.Renting.dao.AddDao;
import com.Renting.dao.GainDao;
import com.Renting.domain.Renting;
import com.Renting.service.ServiceAdd;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ServiceAddImpl implements ServiceAdd {

    @Resource
    AddDao addDao;
    @Resource
    GainDao gainDao;

    //添加新房间
    @Override
    public boolean AddRenting(Renting renting) {
        //查看新房间的编号是否已经存在
        Renting ren= gainDao.GetRentingNumber(renting);
        if(ren==null){
            addDao.AddRenting(renting);
            return true;
        }else{
            return false;
        }

    }
}
